# python的序列化模块pickle类似于java中的serialization

import pickle

user = {'name': 'tom', 'age': 10}

from io import BytesIO

persist = BytesIO()
persist.write(pickle.dumps(user))

print(persist.getvalue())

user1 = pickle.loads(persist.getvalue())

print(user1)

